﻿using System;
using System.Collections.Generic;
using System.Text;
using AutoMapper;
using Hn.Command;
using Hn.Database.Data;

namespace MSocketCore.Model
{
    public class AutoMapperConfig:Profile
    {
        public AutoMapperConfig()
        {
            CreateMap<MyRequestInfo, Packet>()
                .ForMember(p => p.Fn, o => o.MapFrom(src => src._Fn))
                .ForMember(p => p.Pn, o => o.MapFrom(src => src._Pn))
                .ForMember(p => p.Afn, o => o.MapFrom(src => src.Afn.ToString()))
                .ForMember(p => p.Content, o => o.MapFrom(src => BitConverter.ToString(src.Content).Replace("-", " ")));
            CreateMap<LampData, LampData_Realtime>().ForMember(p => p.Id, d => d.Ignore());
            CreateMap<LampData_Realtime, LampData_Realtime>().ForMember(p => p.Id, d => d.Ignore()); ;
        }
    }
}
